package com.hoas.api.core.entity;

import  com.hoas.api.core.exception.BusinessUserCreateException;

/**
 * 权限用户
 * @author ZhangQingmu
 * @date   2016年10月23日
 *
 */
public class BusinessUser {

	private String primaryKey;
	private String userName;
	private String password;
	
	private boolean needLogin = true;
	
	private String encryptType;
	private String encryptKey;
	private String salt;

	public BusinessUser(){

	}
	
	public BusinessUser(String userName, String password) throws BusinessUserCreateException {
		
		if(userName == null || "".equals(userName) || password == null || "".equals(password)) {
			throw new BusinessUserCreateException();
		}
		
		this.userName = userName;
		this.password = password;
	}
	
	public String getUserName() {
		return userName;
	}
	
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	public String getPassword() {
		return password;
	}
	
	public void setPassword(String password) {
		this.password = password;
	}

	public String getEncryptType() {
		return encryptType;
	}

	public void setEncryptType(String encryptType) {
		this.encryptType = encryptType;
	}

	public String getEncryptKey() {
		return encryptKey;
	}

	public void setEncryptKey(String encryptKey) {
		this.encryptKey = encryptKey;
	}
	
	public boolean isNeedLogin() {
		return needLogin;
	}
	
	public void setNeedLogin(boolean needLogin) {
		this.needLogin = needLogin;
	}

	public String getPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(String primaryKey) {
		this.primaryKey = primaryKey;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}
}
